package gameElements;

import java.awt.*;

/**
 * GBox.java
 * 
 * A class modeling a box in the game. 
 * 
 * Fredrik Wallenius and Peter Steiner 
 * DP08 - KTH - 2009
 *
 */
public class GBox extends GfxElement {
	
	protected double sizeX, sizeY;

	/**
	 * 
	 * @param x
	 * @param y
	 * @param color
	 * @param sizeX_
	 * @param sizeY_
	 */
	public GBox(double x, double y, Color color, double sizeX_, double sizeY_) {
		super( x, y,color);
		this.sizeX = sizeX_; this.sizeY = sizeY_; 
	}
	
	public GBox(double x, double y, Color color, double sizeX_, double sizeY_, Boolean causeBounce_, Boolean destroyable_) {
		super( x, y,color, causeBounce_, destroyable_);
		this.sizeX = sizeX_; this.sizeY = sizeY_; 
	}
	
	/**
	 * @return Size in y axis
	 */
	public double getSizeY(){ return sizeY; }
	/**
	 * @return Size in x axis
	 */
	public double getSizeX(){ return sizeX; }
	

	/**
	 * Get this box rectangle values as type
	 * @return Rectangle
	 */
	public Rectangle getBoxRect(){
		return new Rectangle((int) this.x, (int) this.y, (int) this.sizeX, (int) this.sizeY);
	}
	
	
	/**
	 * Called from ElementHandler when ball hits the object
	 */
	public void hit(){
		
	}
	
	/**
	 * @return A boolean stating if this element can be destroyed or not.
	 */
	public Boolean isDestroyable(){
		return false;	
	}
	
	protected void constrain() {

	} 
}
